<template>
    <div v-if="!hasRole">
        <SignArgeeView></SignArgeeView>
    </div>

    <div v-else>
        <ToLiveView></ToLiveView>
    </div>
</template>

<script setup lang="ts">
    import checkRole from '@/utils/checkRole';
    import { ElMessage } from 'element-plus';
    import { useRouter } from 'vue-router';
    import { ref, onMounted } from 'vue'
    import SignArgeeView from './signArgeeView.vue'
    import ToLiveView from './toLiveView.vue'
    const hasRole=ref(false)
    const router = useRouter()
    onMounted(async()=>{
        const response=await checkRole('presenter')
        if(response.code!==200){
            ElMessage.error('获取权限失败')
            router.push("/")
        }else{
            hasRole.value=response.data
        }
    })
</script>

<style scoped>

</style>